package com.bigflexlib.x.mx.controls.Image
{
	import flash.display.Bitmap;
	
	import mx.controls.Image;
	
	
	/**
	 * 
	 * based on: http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=9409
	 * 
	 * @author aldo.bucchi@univrz.com
	 * 
	 */	
	public class SmoothImage extends Image
	{

		override protected function updateDisplayList(unscaledWidth : Number, unscaledHeight : Number) : void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);

            // checks if the image is a bitmap
            if (content is Bitmap)
            {
                var bitmap : Bitmap = content as Bitmap;

                if (bitmap != null && bitmap.smoothing == false)
                {
                    bitmap.smoothing = true;
                }
            }
        }

	}
}